<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    /* 
      事件三要素
        1.事件源
        2.事件类型
        3.事件处理程序
    */
  </style>
</head>

<body>
  <input type="button" value="点击" id="btn">
  <script>
    document.getElementById("btn").addEventListener("click", function () {
      console.log(`大家好呀`);
    });
  </script>
</body>

</html>